#include <iostream>
#include <cassert>
#include <type/xitemdict.h>
#include <type/xitemlist.h>
#include <type/xitemint32.h>
#include <type/xitemint64.h>
#include <type/xitemstring.h>
#include <type/xitemfloat.h>
#include <xitemcall.h>
#include <xprint.h>
#include <xitemfactory.h>
#include <call/xitemcallprint.h>

int main() {

    REGISTER_CREATOR(XItem, XItemCallPrint, L"print")

    auto hello = std::make_shared<XItemString>(L"Hello");
    auto list = std::make_shared<XItemDict>();
    list->addItem(std::wstring(L"name"), std::make_shared<XItemString>(L"X-Script"));
    list->addItem(std::wstring(L"version"), std::make_shared<XItemInt32>(1));

    auto print = XItemFactory::getInstance().createCall(L"print");
    print->addItem(hello);
    print->addItem(list);
    print->invoke();

    return 0;
}
